import React from 'react'
import { useState } from 'react'
import ComA from './ComA'
import ComB from './ComB'

export default function Channel() {
    // 父组件负责状态管理
    const [stateA,setStateA] = useState('A')
    const [stateB,setStateB] = useState('B')
    return (
        <div>
            <ComA stateA={stateA} setStateB={setStateB} setStateA={setStateA}/>
            <ComB stateB={stateB} setStateA={setStateA} setStateB={setStateB}/>
        </div>
    )
}
